package com.cmys.money.cloudshop.service.shopping;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cmys.money.cloudshop.dao.product.ProductTypeDao;
import com.cmys.money.cloudshop.model.product.ProductType;


@Service("shoppingService")
public class ShoppingServiceImpl implements ShoppingService {
	
	protected final Log logger = LogFactory.getLog(getClass());
	
	@Resource(name="productTypeDao")
	private ProductTypeDao productTypeDao;
	
	public ProductTypeDao getProductTypeDao() {
		return productTypeDao;
	}

	public void setProductTypeDao(ProductTypeDao productTypeDao) {
		this.productTypeDao = productTypeDao;
	}

	/**
     * 首页商品分类
     * @return List
     */
    public Collection<ProductType> getShopSortList (){
    	Collection<ProductType> list = productTypeDao.findAll();
        return list;
    }
    
    /**
     * 首页精彩活动推荐
     * @return List
     */
    public ArrayList<Map<String,String>> getJchdList (){
        ArrayList<Map<String,String>> jchdList = new ArrayList<Map<String,String>>();
        Map<String,String> jchd1 = new HashMap<String,String>();
        jchd1.put("name", "居家换新 新品推荐");
        jchd1.put("img", "../images/75c726fb-20ea-43a4-a4a4-35e15d854b67.jpg");
        jchd1.put("url", "http://www.iloosen.com");
        jchdList.add(jchd1);
        Map<String,String> jchd2 = new HashMap<String,String>();
        jchd2.put("name", "特价抢购，快来抢购呀");
        jchd2.put("img", "../images/fad53be1-ee9b-4c6d-a182-aa15e0e35b26.jpg");
        jchd2.put("url", "http://www.iloosen.com");
        jchdList.add(jchd2);
        Map<String,String> jchd3 = new HashMap<String,String>();
        jchd3.put("name", "iMall商城系统V3.0上线了，欢");
        jchd3.put("img", "../images/7bbe209b-459c-4bdf-8f2a-e9192c3fc763.jpg");
        jchd3.put("url", "http://www.iloosen.com");
        jchdList.add(jchd3);
        Map<String,String> jchd4 = new HashMap<String,String>();
        jchd4.put("name", "精美化妆品等你来选购");
        jchd4.put("img", "../images/7788be76-7d48-41b6-9c69-89dbcfeae709.jpg");
        jchd4.put("url", "http://www.iloosen.com");
        jchdList.add(jchd4);
        return jchdList;
    }
    
    /**
     * 首页特价热卖
     * @return List
     */
    public ArrayList<Map<String,String>> getTdrmList (){
        ArrayList<Map<String,String>> tjrmList = new ArrayList<Map<String,String>>();
        Map<String,String> tjrm1 = new HashMap<String,String>();
        tjrm1.put("id", "237");
        tjrm1.put("name", "海鸥表51复刻限量福版蜥蜴皮表带全自动...");
        tjrm1.put("img", "../images/8d693413-e2e5-448b-8e1f-3f4f7630ec94_130X130.jpg");
        tjrm1.put("price", "3200.0");
        tjrmList.add(tjrm1);
        Map<String,String> tjrm2 = new HashMap<String,String>();
        tjrm2.put("id", "38");
        tjrm2.put("name", "优雅立领单排扣束腰呢外套 深裸色");
        tjrm2.put("img", "http://demo.iloosen.com/upload/2011/11/28/feac6437-9cf5-4fcf-b54f-c967f13fe30f_130X130.jpg");
        tjrm2.put("price", "700.0");
        tjrmList.add(tjrm2);
        Map<String,String> tjrm3 = new HashMap<String,String>();
        tjrm3.put("id", "38");
        tjrm3.put("name", "老人头LAORENTOU典雅女士牛皮手抓包");
        tjrm3.put("img", "../images/0e3d980c-b701-4d29-b15a-474b11114994_130X130.jpg");
        tjrm3.put("price", "266.0");
        tjrmList.add(tjrm3);
        Map<String,String> tjrm4 = new HashMap<String,String>();
        tjrm4.put("id", "44");
        tjrm4.put("name", "秋之物语系列时尚女包");
        tjrm4.put("img", "../images/ceba9c6e-db3f-4471-a840-46a039417386_130X130.jpg");
        tjrm4.put("price", "399.0");
        tjrmList.add(tjrm4);
        Map<String,String> tjrm5 = new HashMap<String,String>();
        tjrm5.put("id", "226");
        tjrm5.put("name", "典雅女士牛皮手包");
        tjrm5.put("img", "../images/6799c01e-e47f-4d92-9ead-98b2aac34443_130X130.jpg");
        tjrm5.put("price", "266.0");
        tjrmList.add(tjrm5);
        Map<String,String> tjrm6 = new HashMap<String,String>();
        tjrm6.put("id", "227");
        tjrm6.put("name", "新款复古女包包学院风双肩包多用包");
        tjrm6.put("img", "../images/50b9cf64-6b23-41c2-9d58-44a1acf1a3d7_130X130.jpg");
        tjrm6.put("price", "166.0");
        tjrmList.add(tjrm6);
        return tjrmList;
    }
    
    /**
     * 首页商城公告
     * @return List
     */
    public ArrayList<Map<String,String>> getScggList (){
        ArrayList<Map<String,String>> scggList = new ArrayList<Map<String,String>>();
        Map<String,String> scgg1 = new HashMap<String,String>();
        scgg1.put("name", "iMall商城系统V3.0上线了，欢...");
        scgg1.put("img", "/mallNotice.ac?infArticleId=600934&articleCategoryId=54981");
        scggList.add(scgg1);
        Map<String,String> scgg2 = new HashMap<String,String>();
        scgg2.put("name", "团购疑问");
        scgg2.put("img", "/mallNotice.ac?infArticleId=90011&articleCategoryId=54981");
        scggList.add(scgg2);
        Map<String,String> scgg3 = new HashMap<String,String>();
        scgg3.put("name", "品质也超值-羽绒特卖场");
        scgg3.put("img", "/mallNotice.ac?infArticleId=60091&articleCategoryId=54981");
        scggList.add(scgg3);
        Map<String,String> scgg4 = new HashMap<String,String>();
        scgg4.put("name", "精美化妆品等你来选购");
        scgg4.put("img", "/mallNotice.ac?infArticleId=60092&articleCategoryId=54981");
        scggList.add(scgg4);
        return scggList;
    }
    
    /**
     * 首页促销信息
     * @return List
     */
    public ArrayList<Map<String,String>> getCxxxList (){
        ArrayList<Map<String,String>> cxxxList = new ArrayList<Map<String,String>>();
        Map<String,String> cxxx1 = new HashMap<String,String>();
        cxxx1.put("name", "居家换新 新品推荐");
        cxxx1.put("img", "/mallNotice.ac?infArticleId=60096&articleCategoryId=11");
        cxxxList.add(cxxx1);
        Map<String,String> cxxx2 = new HashMap<String,String>();
        cxxx2.put("name", "精美包包超值特卖限时抢");
        cxxx2.put("img", "/mallNotice.ac?infArticleId=60096&articleCategoryId=11");
        cxxxList.add(cxxx2);
        Map<String,String> cxxx3 = new HashMap<String,String>();
        cxxx3.put("name", "评论送积分");
        cxxx3.put("img", "/mallNotice.ac?infArticleId=60096&articleCategoryId=11");
        cxxxList.add(cxxx3);
        Map<String,String> cxxx4 = new HashMap<String,String>();
        cxxx4.put("name", "积分兑换活动现在开始了！");
        cxxx4.put("img", "/mallNotice.ac?infArticleId=60096&articleCategoryId=11");
        cxxxList.add(cxxx4);
        return cxxxList;
    }

	@Override
	public ArrayList<Map<String, String>> getShopSelectHtml() {
		
		Collection<ProductType> list = productTypeDao.findAll();
		System.out.println(list.size());
		
		
		return null;
	}
}
